<?php

declare(strict_types=1);

namespace App\Controller\Am;

use App\Controller\AbstractController;
use App\Service\LoginService;
use Hyperf\Di\Annotation\Inject;
// 视图
use Hyperf\View\RenderInterface;

class LoginController extends AbstractController
{
    /**
     * @Inject
     * @var LoginService
     */
    protected $service;

    public function index(RenderInterface $render){
        return $render->render('admin/login');
    }

    //验证码
    public function verify()
    {
        $result = $this->service->verify();
        return $this->response->withCookie($result['cookie'])->withAddedHeader('content-type', 'image/png; charset=utf-8')
            ->withContent($result['content']);
    }







}